package com.hyts.agent.base.context;

import lombok.Getter;
import lombok.Setter;

import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.agent.context
 * author:Libo/Alex
 * create-date:2019-06-29 15:29
 * copyright:libo-hyts-github
 * email:libo2dev@aliyun.com
 * description:此类主要用于: Agent探针元数据操作上下文context对象
 */
public class AgentMetadataContext {

    /**
     * 记录全部加载的class对象
     */

    private static Class[] allLoadedClasses ;

    /**
     * 记录class对应的class对象大小
     */
    private static Map<Class<?>,Long> allLoadedClassCacheSize;

    /**
     * 记录当前多少先关classTransFormNum的个数
     */
    private static AtomicInteger classTransFormNum = new AtomicInteger(1);


    public static Class[] getAllLoadedClasses() {
        return allLoadedClasses;
    }

    public static void setAllLoadedClasses(Class[] allLoadedClasses) {
        AgentMetadataContext.allLoadedClasses = allLoadedClasses;
    }

    public static Map<Class<?>, Long> getAllLoadedClassCacheSize() {
        return allLoadedClassCacheSize;
    }

    public static void setAllLoadedClassCacheSize(Map<Class<?>, Long> allLoadedClassCacheSize) {
        AgentMetadataContext.allLoadedClassCacheSize = allLoadedClassCacheSize;
    }

    public static AtomicInteger getClassTransFormNum() {
        return classTransFormNum;
    }

    public static void setClassTransFormNum(AtomicInteger classTransFormNum) {
        AgentMetadataContext.classTransFormNum = classTransFormNum;
    }
}
